{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/DialogInput/index.tsx\";\nimport React from \"react\";\nimport { IconButton, TextField } from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data';\nimport Picker from '@emoji-mart/react';\nimport './DialogInput.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  let {\n    toggleEmojiPicker,\n    emojiPickerVisible,\n    value,\n    textField,\n    setTextField,\n    maxSizeMessage,\n    uploadDocumentHandler,\n    handleSendMessage,\n    pickerRef,\n    addEmoji,\n    flagForStyle,\n    textAreaRef\n  } = _ref;\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"dialogInput-form\",\n    children: [/*#__PURE__*/_jsxDEV(\"div\", {\n      ref: pickerRef,\n      className: \"dialogInput-emoji\",\n      children: [/*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-smile\",\n        onClick: () => toggleEmojiPicker()\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 28,\n        columnNumber: 21\n      }, this), emojiPickerVisible && /*#__PURE__*/_jsxDEV(\"div\", {\n        style: !flagForStyle ? {\n          bottom: `90px`\n        } : {\n          bottom: `117px`\n        },\n        className: \"dialogInput__emoji-picker\",\n        children: /*#__PURE__*/_jsxDEV(Picker, {\n          onEmojiSelect: emojiData => {\n            addEmoji(emojiData.native);\n          },\n          set: \"apple\",\n          theme: \"light\",\n          locale: \"ru\",\n          data: data\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 41,\n          columnNumber: 29\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 34,\n        columnNumber: 25\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 27,\n      columnNumber: 17\n    }, this), /*#__PURE__*/_jsxDEV(TextField, {\n      className: classNames(\"dialogInput-form-input\", {\n        \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n      }),\n      onChange: e => setTextField(e.target.value),\n      onKeyUp: e => e.key === 'Enter' && handleSendMessage(e),\n      value: textField,\n      variant: \"outlined\",\n      label: textField.length > 0 && `${textField.length}/${maxSizeMessage}` || null,\n      multiline: true,\n      rows: flagForStyle ? 3 : 1,\n      placeholder: \"\\u0412\\u0432\\u0435\\u0434\\u0438\\u0442\\u0435 \\u0441\\u043E\\u043E\\u0431\\u0449\\u0435\\u043D\\u0438\\u0435\",\n      inputProps: {\n        'aria-label': 'Введите сообщение'\n      },\n      inputRef: textAreaRef\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 64,\n      columnNumber: 17\n    }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-document\",\n      children: /*#__PURE__*/_jsxDEV(\"input\", {\n        type: \"file\",\n        accept: \"image/*, text/*, application/*\",\n        multiple: true,\n        onChange: e => uploadDocumentHandler(e)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 83,\n        columnNumber: 21\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 79,\n      columnNumber: 17\n    }, this), value && /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-send\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 92,\n      columnNumber: 25\n    }, this) || /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-microphone\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 96,\n      columnNumber: 26\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 26,\n    columnNumber: 13\n  }, this);\n};\n_c = DialogInput;\nexport default DialogInput;\nvar _c;\n$RefreshReg$(_c, \"DialogInput\");","map":{"version":3,"names":["React","IconButton","TextField","classNames","data","Picker","DialogInput","toggleEmojiPicker","emojiPickerVisible","value","textField","setTextField","maxSizeMessage","uploadDocumentHandler","handleSendMessage","pickerRef","addEmoji","flagForStyle","textAreaRef","bottom","emojiData","native","length","e","target","key"],"sources":["/data/messenger.client/src/components/DialogInput/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {IconButton, TextField} from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data'\nimport Picker from '@emoji-mart/react'\nimport {DialogInputProps} from \"../../models/props/DialogInputProps\";\nimport './DialogInput.scss';\n\nconst DialogInput: React.FC<DialogInputProps> = (\n    {\n        toggleEmojiPicker,\n        emojiPickerVisible,\n        value,\n        textField,\n        setTextField,\n        maxSizeMessage,\n        uploadDocumentHandler,\n        handleSendMessage,\n        pickerRef,\n        addEmoji,\n        flagForStyle,\n        textAreaRef\n    }\n) => {\n    return (\n            <div className=\"dialogInput-form\">\n                <div ref={pickerRef} className=\"dialogInput-emoji\">\n                    <IconButton\n                        type=\"button\"\n                        className='dialogInput-form-smile'\n                        onClick={() => toggleEmojiPicker()}\n                    />\n                    {emojiPickerVisible && (\n                        <div\n                            style={\n                            !flagForStyle?\n                                {bottom: `90px`}:\n                                {bottom: `117px`}\n                        }\n                            className=\"dialogInput__emoji-picker\">\n                            <Picker\n                                onEmojiSelect={\n                                    (emojiData: {\n                                        id: string;\n                                        name: string;\n                                        /** emoji */\n                                        native: string;\n                                        /** unicode */\n                                        unified: string;\n                                        keywords: string[];\n                                        shortcodes: string;\n                                    }) => {\n                                        addEmoji(emojiData.native);\n                                    }\n                                }\n                                set=\"apple\"\n                                theme=\"light\"\n                                locale=\"ru\"\n                                data={data}\n                            />\n                        </div>\n                    )}\n                </div>\n                <TextField\n                    className={classNames(\"dialogInput-form-input\", {\n                        \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n                    })}\n                    onChange={e => (setTextField(e.target.value))}\n                    onKeyUp={e => e.key === 'Enter' && handleSendMessage(e)}\n                    value={textField}\n                    variant=\"outlined\"\n                    label={((textField.length > 0 && `${textField.length}/${maxSizeMessage}`) || null)}\n                    multiline\n                    rows={flagForStyle? 3: 1}\n                    placeholder=\"Введите сообщение\"\n                    inputProps={{ 'aria-label': 'Введите сообщение' }}\n                    inputRef={textAreaRef}\n                />\n                <IconButton\n                    type=\"button\"\n                    className='dialogInput-form-document'\n                >\n                    <input\n                        type=\"file\"\n                        accept=\"image/*, text/*, application/*\"\n                        multiple={true}\n                        onChange={e => uploadDocumentHandler(e)}\n                    />\n                </IconButton>\n                {\n                    (value &&\n                        <IconButton\n                            type=\"button\"\n                            className='dialogInput-form-send'\n                        />) ||\n                        (<IconButton\n                            type=\"button\"\n                            className='dialogInput-form-microphone'\n                        />)\n                }\n        </div>\n    );\n}\n\nexport default DialogInput;"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,UAAU,EAAEC,SAAS,QAAO,eAAe;AACnD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,kBAAkB;AACnC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,OAAO,oBAAoB;AAAC;AAE5B,MAAMC,WAAuC,GAAG,QAe3C;EAAA,IAdD;IACIC,iBAAiB;IACjBC,kBAAkB;IAClBC,KAAK;IACLC,SAAS;IACTC,YAAY;IACZC,cAAc;IACdC,qBAAqB;IACrBC,iBAAiB;IACjBC,SAAS;IACTC,QAAQ;IACRC,YAAY;IACZC;EACJ,CAAC;EAED,oBACQ;IAAK,SAAS,EAAC,kBAAkB;IAAA,wBAC7B;MAAK,GAAG,EAAEH,SAAU;MAAC,SAAS,EAAC,mBAAmB;MAAA,wBAC9C,QAAC,UAAU;QACP,IAAI,EAAC,QAAQ;QACb,SAAS,EAAC,wBAAwB;QAClC,OAAO,EAAE,MAAMR,iBAAiB;MAAG;QAAA;QAAA;QAAA;MAAA,QACrC,EACDC,kBAAkB,iBACf;QACI,KAAK,EACL,CAACS,YAAY,GACT;UAACE,MAAM,EAAG;QAAK,CAAC,GAChB;UAACA,MAAM,EAAG;QAAM,CACvB;QACG,SAAS,EAAC,2BAA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